home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / dbctrls.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  49.0 KB  |  1,396 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'DBCtrls.pas' rev: 3.00
  6.  
  7. #ifndef DBCtrlsHPP
  8. #define DBCtrlsHPP
  9. #include <Db.hpp>
  10. #include <ComCtrls.hpp>
  11. #include <Buttons.hpp>
  12. #include <Mask.hpp>
  13. #include <ExtCtrls.hpp>
  14. #include <StdCtrls.hpp>
  15. #include <Menus.hpp>
  16. #include <Graphics.hpp>
  17. #include <Forms.hpp>
  18. #include <Controls.hpp>
  19. #include <Classes.hpp>
  20. #include <Messages.hpp>
  21. #include <SysUtils.hpp>
  22. #include <Windows.hpp>
  23. #include <SysInit.hpp>
  24. #include <System.hpp>
  25.  
  26. //-- user supplied -----------------------------------------------------------
  27.  
  28. namespace Dbctrls
  29. {
  30. //-- type declarations -------------------------------------------------------
  31. class DELPHICLASS TFieldDataLink;
  32. class PASCALIMPLEMENTATION TFieldDataLink : public Db::TDataLink 
  33. {
  34.     typedef Db::TDataLink inherited;
  35.     
  36. private:
  37.     Db::TField* FField;
  38.     System::AnsiString FFieldName;
  39.     Classes::TComponent* FControl;
  40.     bool FEditing;
  41.     bool FModified;
  42.     Classes::TNotifyEvent FOnDataChange;
  43.     Classes::TNotifyEvent FOnEditingChange;
  44.     Classes::TNotifyEvent FOnUpdateData;
  45.     Classes::TNotifyEvent FOnActiveChange;
  46.     bool __fastcall GetCanModify(void);
  47.     HIDESBASE void __fastcall SetEditing(bool Value);
  48.     void __fastcall SetField(Db::TField* Value);
  49.     void __fastcall SetFieldName(const System::AnsiString Value);
  50.     void __fastcall UpdateField(void);
  51.     
  52. protected:
  53.     virtual void __fastcall ActiveChanged(void);
  54.     virtual void __fastcall EditingChanged(void);
  55.     virtual void __fastcall FocusControl(Db::TFieldRef Field);
  56.     virtual void __fastcall LayoutChanged(void);
  57.     virtual void __fastcall RecordChanged(Db::TField* Field);
  58.     virtual void __fastcall UpdateData(void);
  59.     
  60. public:
  61.     HIDESBASE bool __fastcall Edit(void);
  62.     void __fastcall Modified(void);
  63.     void __fastcall Reset(void);
  64.     __property bool CanModify = {read=GetCanModify, nodefault};
  65.     __property Classes::TComponent* Control = {read=FControl, write=FControl};
  66.     __property bool Editing = {read=FEditing, nodefault};
  67.     __property Db::TField* Field = {read=FField};
  68.     __property System::AnsiString FieldName = {read=FFieldName, write=SetFieldName};
  69.     __property Classes::TNotifyEvent OnDataChange = {read=FOnDataChange, write=FOnDataChange};
  70.     __property Classes::TNotifyEvent OnEditingChange = {read=FOnEditingChange, write=FOnEditingChange};
  71.         
  72.     __property Classes::TNotifyEvent OnUpdateData = {read=FOnUpdateData, write=FOnUpdateData};
  73.     __property Classes::TNotifyEvent OnActiveChange = {read=FOnActiveChange, write=FOnActiveChange};
  74. public:
  75.         
  76.     /* TDataLink.Create */ __fastcall TFieldDataLink(void) : Db::TDataLink() { }
  77.     /* TDataLink.Destroy */ __fastcall virtual ~TFieldDataLink(void) { }
  78.     
  79. };
  80.  
  81. class DELPHICLASS TPaintControl;
  82. class PASCALIMPLEMENTATION TPaintControl : public System::TObject 
  83. {
  84.     typedef System::TObject inherited;
  85.     
  86. private:
  87.     Controls::TWinControl* FOwner;
  88.     System::AnsiString FClassName;
  89.     HWND FHandle;
  90.     void *FObjectInstance;
  91.     void *FDefWindowProc;
  92.     bool FCtl3dButton;
  93.     HWND __fastcall GetHandle(void);
  94.     void __fastcall SetCtl3DButton(bool Value);
  95.     void __fastcall WndProc(Messages::TMessage &Message);
  96.     
  97. public:
  98.     __fastcall TPaintControl(Controls::TWinControl* AOwner, const System::AnsiString ClassName);
  99.     __fastcall virtual ~TPaintControl(void);
  100.     void __fastcall DestroyHandle(void);
  101.     __property bool Ctl3DButton = {read=FCtl3dButton, write=SetCtl3DButton, nodefault};
  102.     __property HWND Handle = {read=GetHandle, nodefault};
  103. };
  104.  
  105. class DELPHICLASS TDBEdit;
  106. class PASCALIMPLEMENTATION TDBEdit : public Mask::TCustomMaskEdit 
  107. {
  108.     typedef Mask::TCustomMaskEdit inherited;
  109.     
  110. private:
  111.     TFieldDataLink* FDataLink;
  112.     Controls::TControlCanvas* FCanvas;
  113.     TAlignment FAlignment;
  114.     bool FFocused;
  115.     void __fastcall DataChange(System::TObject* Sender);
  116.     void __fastcall EditingChange(System::TObject* Sender);
  117.     System::AnsiString __fastcall GetDataField(void);
  118.     Db::TDataSource* __fastcall GetDataSource(void);
  119.     Db::TField* __fastcall GetField(void);
  120.     bool __fastcall GetReadOnly(void);
  121.     tagPOINT __fastcall GetTextMargins(void);
  122.     void __fastcall SetDataField(const System::AnsiString Value);
  123.     void __fastcall SetDataSource(Db::TDataSource* Value);
  124.     void __fastcall SetFocused(bool Value);
  125.     HIDESBASE void __fastcall SetReadOnly(bool Value);
  126.     void __fastcall UpdateData(System::TObject* Sender);
  127.     HIDESBASE MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
  128.     HIDESBASE MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
  129.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  130.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  131.     HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  132.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  133.     
  134. protected:
  135.     DYNAMIC void __fastcall Change(void);
  136.     virtual bool __fastcall EditCanModify(void);
  137.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  138.     DYNAMIC void __fastcall KeyPress(char &Key);
  139.     virtual void __fastcall Loaded(void);
  140.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  141.         );
  142.     virtual void __fastcall Reset(void);
  143.     
  144. public:
  145.     __fastcall virtual TDBEdit(Classes::TComponent* AOwner);
  146.     __fastcall virtual ~TDBEdit(void);
  147.     __property Db::TField* Field = {read=GetField};
  148.     
  149. __published:
  150.     __property AutoSelect ;
  151.     __property AutoSize ;
  152.     __property BorderStyle ;
  153.     __property CharCase ;
  154.     __property Color ;
  155.     __property Ctl3D ;
  156.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  157.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  158.     __property DragCursor ;
  159.     __property DragMode ;
  160.     __property Enabled ;
  161.     __property Font ;
  162.     __property ImeMode ;
  163.     __property ImeName ;
  164.     __property MaxLength ;
  165.     __property ParentColor ;
  166.     __property ParentCtl3D ;
  167.     __property ParentFont ;
  168.     __property ParentShowHint ;
  169.     __property PasswordChar ;
  170.     __property PopupMenu ;
  171.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  172.     __property ShowHint ;
  173.     __property TabOrder ;
  174.     __property TabStop ;
  175.     __property Visible ;
  176.     __property OnChange ;
  177.     __property OnClick ;
  178.     __property OnDblClick ;
  179.     __property OnDragDrop ;
  180.     __property OnDragOver ;
  181.     __property OnEndDrag ;
  182.     __property OnEnter ;
  183.     __property OnExit ;
  184.     __property OnKeyDown ;
  185.     __property OnKeyPress ;
  186.     __property OnKeyUp ;
  187.     __property OnMouseDown ;
  188.     __property OnMouseMove ;
  189.     __property OnMouseUp ;
  190.     __property OnStartDrag ;
  191. public:
  192.     /* TWinControl.CreateParented */ __fastcall TDBEdit(HWND ParentWindow) : Mask::TCustomMaskEdit(ParentWindow
  193.         ) { }
  194.     
  195. };
  196.  
  197. class DELPHICLASS TDBText;
  198. class PASCALIMPLEMENTATION TDBText : public Stdctrls::TCustomLabel 
  199. {
  200.     typedef Stdctrls::TCustomLabel inherited;
  201.     
  202. private:
  203.     TFieldDataLink* FDataLink;
  204.     void __fastcall DataChange(System::TObject* Sender);
  205.     System::AnsiString __fastcall GetDataField(void);
  206.     Db::TDataSource* __fastcall GetDataSource(void);
  207.     Db::TField* __fastcall GetField(void);
  208.     System::AnsiString __fastcall GetFieldText(void);
  209.     void __fastcall SetDataField(const System::AnsiString Value);
  210.     void __fastcall SetDataSource(Db::TDataSource* Value);
  211.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  212.     
  213. protected:
  214.     virtual System::AnsiString __fastcall GetLabelText(void);
  215.     virtual void __fastcall Loaded(void);
  216.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  217.         );
  218.     virtual void __fastcall SetAutoSize(bool Value);
  219.     
  220. public:
  221.     __fastcall virtual TDBText(Classes::TComponent* AOwner);
  222.     __fastcall virtual ~TDBText(void);
  223.     __property Db::TField* Field = {read=GetField};
  224.     
  225. __published:
  226.     __property Align ;
  227.     __property Alignment ;
  228.     __property AutoSize ;
  229.     __property Color ;
  230.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  231.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  232.     __property DragCursor ;
  233.     __property DragMode ;
  234.     __property Enabled ;
  235.     __property Font ;
  236.     __property ParentColor ;
  237.     __property ParentFont ;
  238.     __property ParentShowHint ;
  239.     __property PopupMenu ;
  240.     __property Transparent ;
  241.     __property ShowHint ;
  242.     __property Visible ;
  243.     __property WordWrap ;
  244.     __property OnClick ;
  245.     __property OnDblClick ;
  246.     __property OnDragDrop ;
  247.     __property OnDragOver ;
  248.     __property OnEndDrag ;
  249.     __property OnMouseDown ;
  250.     __property OnMouseMove ;
  251.     __property OnMouseUp ;
  252.     __property OnStartDrag ;
  253. };
  254.  
  255. class DELPHICLASS TDBCheckBox;
  256. class PASCALIMPLEMENTATION TDBCheckBox : public Stdctrls::TCustomCheckBox 
  257. {
  258.     typedef Stdctrls::TCustomCheckBox inherited;
  259.     
  260. private:
  261.     TFieldDataLink* FDataLink;
  262.     System::AnsiString FValueCheck;
  263.     System::AnsiString FValueUncheck;
  264.     TPaintControl* FPaintControl;
  265.     void __fastcall DataChange(System::TObject* Sender);
  266.     System::AnsiString __fastcall GetDataField(void);
  267.     Db::TDataSource* __fastcall GetDataSource(void);
  268.     Db::TField* __fastcall GetField(void);
  269.     Stdctrls::TCheckBoxState __fastcall GetFieldState(void);
  270.     bool __fastcall GetReadOnly(void);
  271.     void __fastcall SetDataField(const System::AnsiString Value);
  272.     void __fastcall SetDataSource(Db::TDataSource* Value);
  273.     void __fastcall SetReadOnly(bool Value);
  274.     void __fastcall SetValueCheck(const System::AnsiString Value);
  275.     void __fastcall SetValueUncheck(const System::AnsiString Value);
  276.     void __fastcall UpdateData(System::TObject* Sender);
  277.     bool __fastcall ValueMatch(const System::AnsiString ValueList, const System::AnsiString Value);
  278.     HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  279.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  280.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  281.     
  282. protected:
  283.     virtual void __fastcall Toggle(void);
  284.     DYNAMIC void __fastcall KeyPress(char &Key);
  285.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  286.         );
  287.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  288.     
  289. public:
  290.     __fastcall virtual TDBCheckBox(Classes::TComponent* AOwner);
  291.     __fastcall virtual ~TDBCheckBox(void);
  292.     __property Checked ;
  293.     __property Db::TField* Field = {read=GetField};
  294.     __property State ;
  295.     
  296. __published:
  297.     __property Alignment ;
  298.     __property AllowGrayed ;
  299.     __property Caption ;
  300.     __property Color ;
  301.     __property Ctl3D ;
  302.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  303.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  304.     __property DragCursor ;
  305.     __property DragMode ;
  306.     __property Enabled ;
  307.     __property Font ;
  308.     __property ParentColor ;
  309.     __property ParentCtl3D ;
  310.     __property ParentFont ;
  311.     __property ParentShowHint ;
  312.     __property PopupMenu ;
  313.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  314.     __property ShowHint ;
  315.     __property TabOrder ;
  316.     __property TabStop ;
  317.     __property System::AnsiString ValueChecked = {read=FValueCheck, write=SetValueCheck};
  318.     __property System::AnsiString ValueUnchecked = {read=FValueUncheck, write=SetValueUncheck};
  319.     __property Visible ;
  320.     __property OnClick ;
  321.     __property OnDragDrop ;
  322.     __property OnDragOver ;
  323.     __property OnEndDrag ;
  324.     __property OnEnter ;
  325.     __property OnExit ;
  326.     __property OnKeyDown ;
  327.     __property OnKeyPress ;
  328.     __property OnKeyUp ;
  329.     __property OnMouseDown ;
  330.     __property OnMouseMove ;
  331.     __property OnMouseUp ;
  332.     __property OnStartDrag ;
  333. public:
  334.     /* TWinControl.CreateParented */ __fastcall TDBCheckBox(HWND ParentWindow) : Stdctrls::TCustomCheckBox(
  335.         ParentWindow) { }
  336.     
  337. };
  338.  
  339. class DELPHICLASS TDBComboBox;
  340. class PASCALIMPLEMENTATION TDBComboBox : public Stdctrls::TCustomComboBox 
  341. {
  342.     typedef Stdctrls::TCustomComboBox inherited;
  343.     
  344. private:
  345.     TFieldDataLink* FDataLink;
  346.     TPaintControl* FPaintControl;
  347.     void __fastcall DataChange(System::TObject* Sender);
  348.     void __fastcall EditingChange(System::TObject* Sender);
  349.     System::AnsiString __fastcall GetComboText(void);
  350.     System::AnsiString __fastcall GetDataField(void);
  351.     Db::TDataSource* __fastcall GetDataSource(void);
  352.     Db::TField* __fastcall GetField(void);
  353.     bool __fastcall GetReadOnly(void);
  354.     void __fastcall SetComboText(const System::AnsiString Value);
  355.     void __fastcall SetDataField(const System::AnsiString Value);
  356.     void __fastcall SetDataSource(Db::TDataSource* Value);
  357.     void __fastcall SetEditReadOnly(void);
  358.     HIDESBASE void __fastcall SetItems(Classes::TStrings* Value);
  359.     void __fastcall SetReadOnly(bool Value);
  360.     void __fastcall UpdateData(System::TObject* Sender);
  361.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  362.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  363.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  364.     HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  365.     
  366. protected:
  367.     DYNAMIC void __fastcall Change(void);
  368.     DYNAMIC void __fastcall Click(void);
  369.     virtual void __fastcall ComboWndProc(Messages::TMessage &Message, HWND ComboWnd, void * ComboProc);
  370.         
  371.     virtual void __fastcall CreateWnd(void);
  372.     DYNAMIC void __fastcall DropDown(void);
  373.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  374.     DYNAMIC void __fastcall KeyPress(char &Key);
  375.     virtual void __fastcall Loaded(void);
  376.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  377.         );
  378.     virtual void __fastcall SetStyle(Stdctrls::TComboBoxStyle Value);
  379.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  380.     
  381. public:
  382.     __fastcall virtual TDBComboBox(Classes::TComponent* AOwner);
  383.     __fastcall virtual ~TDBComboBox(void);
  384.     __property Db::TField* Field = {read=GetField};
  385.     __property Text ;
  386.     
  387. __published:
  388.     __property Style ;
  389.     __property Color ;
  390.     __property Ctl3D ;
  391.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  392.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  393.     __property DragMode ;
  394.     __property DragCursor ;
  395.     __property DropDownCount ;
  396.     __property Enabled ;
  397.     __property Font ;
  398.     __property ImeMode ;
  399.     __property ImeName ;
  400.     __property ItemHeight ;
  401.     __property Items  = {write=SetItems};
  402.     __property ParentColor ;
  403.     __property ParentCtl3D ;
  404.     __property ParentFont ;
  405.     __property ParentShowHint ;
  406.     __property PopupMenu ;
  407.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  408.     __property ShowHint ;
  409.     __property Sorted ;
  410.     __property TabOrder ;
  411.     __property TabStop ;
  412.     __property Visible ;
  413.     __property OnChange ;
  414.     __property OnClick ;
  415.     __property OnDblClick ;
  416.     __property OnDragDrop ;
  417.     __property OnDragOver ;
  418.     __property OnDrawItem ;
  419.     __property OnDropDown ;
  420.     __property OnEndDrag ;
  421.     __property OnEnter ;
  422.     __property OnExit ;
  423.     __property OnKeyDown ;
  424.     __property OnKeyPress ;
  425.     __property OnKeyUp ;
  426.     __property OnMeasureItem ;
  427.     __property OnStartDrag ;
  428. public:
  429.     /* TWinControl.CreateParented */ __fastcall TDBComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
  430.         ParentWindow) { }
  431.     
  432. };
  433.  
  434. class DELPHICLASS TDBListBox;
  435. class PASCALIMPLEMENTATION TDBListBox : public Stdctrls::TCustomListBox 
  436. {
  437.     typedef Stdctrls::TCustomListBox inherited;
  438.     
  439. private:
  440.     TFieldDataLink* FDataLink;
  441.     void __fastcall DataChange(System::TObject* Sender);
  442.     void __fastcall UpdateData(System::TObject* Sender);
  443.     System::AnsiString __fastcall GetDataField(void);
  444.     Db::TDataSource* __fastcall GetDataSource(void);
  445.     Db::TField* __fastcall GetField(void);
  446.     bool __fastcall GetReadOnly(void);
  447.     void __fastcall SetDataField(const System::AnsiString Value);
  448.     void __fastcall SetDataSource(Db::TDataSource* Value);
  449.     void __fastcall SetReadOnly(bool Value);
  450.     HIDESBASE void __fastcall SetItems(Classes::TStrings* Value);
  451.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  452.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  453.     
  454. protected:
  455.     DYNAMIC void __fastcall Click(void);
  456.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  457.     DYNAMIC void __fastcall KeyPress(char &Key);
  458.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  459.         );
  460.     
  461. public:
  462.     __fastcall virtual TDBListBox(Classes::TComponent* AOwner);
  463.     __fastcall virtual ~TDBListBox(void);
  464.     __property Db::TField* Field = {read=GetField};
  465.     
  466. __published:
  467.     __property Align ;
  468.     __property BorderStyle ;
  469.     __property Color ;
  470.     __property Ctl3D ;
  471.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  472.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  473.     __property DragCursor ;
  474.     __property DragMode ;
  475.     __property Enabled ;
  476.     __property Font ;
  477.     __property ImeMode ;
  478.     __property ImeName ;
  479.     __property IntegralHeight ;
  480.     __property ItemHeight ;
  481.     __property Items  = {write=SetItems};
  482.     __property ParentColor ;
  483.     __property ParentCtl3D ;
  484.     __property ParentFont ;
  485.     __property ParentShowHint ;
  486.     __property PopupMenu ;
  487.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  488.     __property ShowHint ;
  489.     __property Style ;
  490.     __property TabOrder ;
  491.     __property TabStop ;
  492.     __property Visible ;
  493.     __property OnClick ;
  494.     __property OnDblClick ;
  495.     __property OnDragDrop ;
  496.     __property OnDragOver ;
  497.     __property OnDrawItem ;
  498.     __property OnEndDrag ;
  499.     __property OnEnter ;
  500.     __property OnExit ;
  501.     __property OnKeyDown ;
  502.     __property OnKeyPress ;
  503.     __property OnKeyUp ;
  504.     __property OnMeasureItem ;
  505.     __property OnMouseDown ;
  506.     __property OnMouseMove ;
  507.     __property OnMouseUp ;
  508.     __property OnStartDrag ;
  509. public:
  510.     /* TWinControl.CreateParented */ __fastcall TDBListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
  511.         ParentWindow) { }
  512.     
  513. };
  514.  
  515. class DELPHICLASS TDBRadioGroup;
  516. class PASCALIMPLEMENTATION TDBRadioGroup : public Extctrls::TCustomRadioGroup 
  517. {
  518.     typedef Extctrls::TCustomRadioGroup inherited;
  519.     
  520. private:
  521.     TFieldDataLink* FDataLink;
  522.     System::AnsiString FValue;
  523.     Classes::TStrings* FValues;
  524.     bool FInSetValue;
  525.     Classes::TNotifyEvent FOnChange;
  526.     void __fastcall DataChange(System::TObject* Sender);
  527.     void __fastcall UpdateData(System::TObject* Sender);
  528.     System::AnsiString __fastcall GetDataField(void);
  529.     Db::TDataSource* __fastcall GetDataSource(void);
  530.     Db::TField* __fastcall GetField(void);
  531.     bool __fastcall GetReadOnly(void);
  532.     System::AnsiString __fastcall GetButtonValue(int Index);
  533.     void __fastcall SetDataField(const System::AnsiString Value);
  534.     void __fastcall SetDataSource(Db::TDataSource* Value);
  535.     void __fastcall SetReadOnly(bool Value);
  536.     void __fastcall SetValue(const System::AnsiString Value);
  537.     HIDESBASE void __fastcall SetItems(Classes::TStrings* Value);
  538.     void __fastcall SetValues(Classes::TStrings* Value);
  539.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  540.     
  541. protected:
  542.     DYNAMIC void __fastcall Change(void);
  543.     DYNAMIC void __fastcall Click(void);
  544.     DYNAMIC void __fastcall KeyPress(char &Key);
  545.     virtual bool __fastcall CanModify(void);
  546.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  547.         );
  548.     __property TFieldDataLink* DataLink = {read=FDataLink};
  549.     
  550. public:
  551.     __fastcall virtual TDBRadioGroup(Classes::TComponent* AOwner);
  552.     __fastcall virtual ~TDBRadioGroup(void);
  553.     __property Db::TField* Field = {read=GetField};
  554.     __property ItemIndex ;
  555.     __property System::AnsiString Value = {read=FValue, write=SetValue};
  556.     
  557. __published:
  558.     __property Align ;
  559.     __property Caption ;
  560.     __property Color ;
  561.     __property Columns ;
  562.     __property Ctl3D ;
  563.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  564.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  565.     __property DragCursor ;
  566.     __property DragMode ;
  567.     __property Enabled ;
  568.     __property Font ;
  569.     __property Items  = {write=SetItems};
  570.     __property ParentColor ;
  571.     __property ParentCtl3D ;
  572.     __property ParentFont ;
  573.     __property ParentShowHint ;
  574.     __property PopupMenu ;
  575.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  576.     __property ShowHint ;
  577.     __property TabOrder ;
  578.     __property TabStop ;
  579.     __property Classes::TStrings* Values = {read=FValues, write=SetValues};
  580.     __property Visible ;
  581.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  582.     __property OnClick ;
  583.     __property OnDragDrop ;
  584.     __property OnDragOver ;
  585.     __property OnEndDrag ;
  586.     __property OnEnter ;
  587.     __property OnExit ;
  588.     __property OnStartDrag ;
  589. public:
  590.     /* TWinControl.CreateParented */ __fastcall TDBRadioGroup(HWND ParentWindow) : Extctrls::TCustomRadioGroup(
  591.         ParentWindow) { }
  592.     
  593. };
  594.  
  595. class DELPHICLASS TDBMemo;
  596. class PASCALIMPLEMENTATION TDBMemo : public Stdctrls::TCustomMemo 
  597. {
  598.     typedef Stdctrls::TCustomMemo inherited;
  599.     
  600. private:
  601.     TFieldDataLink* FDataLink;
  602.     bool FAutoDisplay;
  603.     bool FFocused;
  604.     bool FMemoLoaded;
  605.     TPaintControl* FPaintControl;
  606.     void __fastcall DataChange(System::TObject* Sender);
  607.     void __fastcall EditingChange(System::TObject* Sender);
  608.     System::AnsiString __fastcall GetDataField(void);
  609.     Db::TDataSource* __fastcall GetDataSource(void);
  610.     Db::TField* __fastcall GetField(void);
  611.     bool __fastcall GetReadOnly(void);
  612.     void __fastcall SetDataField(const System::AnsiString Value);
  613.     void __fastcall SetDataSource(Db::TDataSource* Value);
  614.     HIDESBASE void __fastcall SetReadOnly(bool Value);
  615.     void __fastcall SetAutoDisplay(bool Value);
  616.     void __fastcall SetFocused(bool Value);
  617.     void __fastcall UpdateData(System::TObject* Sender);
  618.     MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
  619.     MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
  620.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  621.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  622.     HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  623.     HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  624.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  625.     
  626. protected:
  627.     DYNAMIC void __fastcall Change(void);
  628.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  629.     DYNAMIC void __fastcall KeyPress(char &Key);
  630.     virtual void __fastcall Loaded(void);
  631.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  632.         );
  633.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  634.     
  635. public:
  636.     __fastcall virtual TDBMemo(Classes::TComponent* AOwner);
  637.     __fastcall virtual ~TDBMemo(void);
  638.     void __fastcall LoadMemo(void);
  639.     __property Db::TField* Field = {read=GetField};
  640.     
  641. __published:
  642.     __property Align ;
  643.     __property Alignment ;
  644.     __property bool AutoDisplay = {read=FAutoDisplay, write=SetAutoDisplay, default=1};
  645.     __property BorderStyle ;
  646.     __property Color ;
  647.     __property Ctl3D ;
  648.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  649.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  650.     __property DragCursor ;
  651.     __property DragMode ;
  652.     __property Enabled ;
  653.     __property Font ;
  654.     __property ImeMode ;
  655.     __property ImeName ;
  656.     __property MaxLength ;
  657.     __property ParentColor ;
  658.     __property ParentCtl3D ;
  659.     __property ParentFont ;
  660.     __property ParentShowHint ;
  661.     __property PopupMenu ;
  662.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  663.     __property ScrollBars ;
  664.     __property ShowHint ;
  665.     __property TabOrder ;
  666.     __property TabStop ;
  667.     __property Visible ;
  668.     __property WantTabs ;
  669.     __property WordWrap ;
  670.     __property OnChange ;
  671.     __property OnClick ;
  672.     __property OnDblClick ;
  673.     __property OnDragDrop ;
  674.     __property OnDragOver ;
  675.     __property OnEndDrag ;
  676.     __property OnEnter ;
  677.     __property OnExit ;
  678.     __property OnKeyDown ;
  679.     __property OnKeyPress ;
  680.     __property OnKeyUp ;
  681.     __property OnMouseDown ;
  682.     __property OnMouseMove ;
  683.     __property OnMouseUp ;
  684.     __property OnStartDrag ;
  685. public:
  686.     /* TWinControl.CreateParented */ __fastcall TDBMemo(HWND ParentWindow) : Stdctrls::TCustomMemo(ParentWindow
  687.         ) { }
  688.     
  689. };
  690.  
  691. class DELPHICLASS TDBImage;
  692. class PASCALIMPLEMENTATION TDBImage : public Controls::TCustomControl 
  693. {
  694.     typedef Controls::TCustomControl inherited;
  695.     
  696. private:
  697.     TFieldDataLink* FDataLink;
  698.     Graphics::TPicture* FPicture;
  699.     TFormBorderStyle FBorderStyle;
  700.     bool FAutoDisplay;
  701.     bool FStretch;
  702.     bool FCenter;
  703.     bool FPictureLoaded;
  704.     bool FQuickDraw;
  705.     void __fastcall DataChange(System::TObject* Sender);
  706.     System::AnsiString __fastcall GetDataField(void);
  707.     Db::TDataSource* __fastcall GetDataSource(void);
  708.     Db::TField* __fastcall GetField(void);
  709.     bool __fastcall GetReadOnly(void);
  710.     void __fastcall PictureChanged(System::TObject* Sender);
  711.     void __fastcall SetAutoDisplay(bool Value);
  712.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  713.     void __fastcall SetCenter(bool Value);
  714.     void __fastcall SetDataField(const System::AnsiString Value);
  715.     void __fastcall SetDataSource(Db::TDataSource* Value);
  716.     void __fastcall SetPicture(Graphics::TPicture* Value);
  717.     void __fastcall SetReadOnly(bool Value);
  718.     void __fastcall SetStretch(bool Value);
  719.     void __fastcall UpdateData(System::TObject* Sender);
  720.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  721.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  722.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  723.     MESSAGE void __fastcall CMTextChanged(Messages::TMessage &Message);
  724.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  725.     HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  726.     MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
  727.     MESSAGE void __fastcall WMCopy(Messages::TMessage &Message);
  728.     MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
  729.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TMessage &Message);
  730.     
  731. protected:
  732.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  733.     DYNAMIC HPALETTE __fastcall GetPalette(void);
  734.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  735.     DYNAMIC void __fastcall KeyPress(char &Key);
  736.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  737.         );
  738.     virtual void __fastcall Paint(void);
  739.     
  740. public:
  741.     __fastcall virtual TDBImage(Classes::TComponent* AOwner);
  742.     __fastcall virtual ~TDBImage(void);
  743.     void __fastcall CopyToClipboard(void);
  744.     void __fastcall CutToClipboard(void);
  745.     void __fastcall LoadPicture(void);
  746.     void __fastcall PasteFromClipboard(void);
  747.     __property Db::TField* Field = {read=GetField};
  748.     __property Graphics::TPicture* Picture = {read=FPicture, write=SetPicture};
  749.     
  750. __published:
  751.     __property Align ;
  752.     __property bool AutoDisplay = {read=FAutoDisplay, write=SetAutoDisplay, default=1};
  753.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
  754.     __property bool Center = {read=FCenter, write=SetCenter, default=1};
  755.     __property Color ;
  756.     __property Ctl3D ;
  757.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  758.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  759.     __property DragCursor ;
  760.     __property DragMode ;
  761.     __property Enabled ;
  762.     __property Font ;
  763.     __property ParentColor ;
  764.     __property ParentCtl3D ;
  765.     __property ParentFont ;
  766.     __property ParentShowHint ;
  767.     __property PopupMenu ;
  768.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  769.     __property bool QuickDraw = {read=FQuickDraw, write=FQuickDraw, default=1};
  770.     __property ShowHint ;
  771.     __property bool Stretch = {read=FStretch, write=SetStretch, default=0};
  772.     __property TabOrder ;
  773.     __property TabStop ;
  774.     __property Visible ;
  775.     __property OnClick ;
  776.     __property OnDblClick ;
  777.     __property OnDragDrop ;
  778.     __property OnDragOver ;
  779.     __property OnEndDrag ;
  780.     __property OnEnter ;
  781.     __property OnExit ;
  782.     __property OnKeyDown ;
  783.     __property OnKeyPress ;
  784.     __property OnKeyUp ;
  785.     __property OnMouseDown ;
  786.     __property OnMouseMove ;
  787.     __property OnMouseUp ;
  788.     __property OnStartDrag ;
  789. public:
  790.     /* TWinControl.CreateParented */ __fastcall TDBImage(HWND ParentWindow) : Controls::TCustomControl(
  791.         ParentWindow) { }
  792.     
  793. };
  794.  
  795. enum TNavGlyph { ngEnabled, ngDisabled };
  796.  
  797. enum TNavigateBtn { nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, 
  798.     nbRefresh };
  799.  
  800. typedef Set<TNavigateBtn, nbFirst, nbRefresh>  TButtonSet;
  801.  
  802. enum DBCtrls__11 { nsAllowTimer, nsFocusRect };
  803.  
  804. typedef Set<DBCtrls__11, nsAllowTimer, nsFocusRect>  TNavButtonStyle;
  805.  
  806. typedef void __fastcall (__closure *ENavClick)(System::TObject* Sender, TNavigateBtn Button);
  807.  
  808. class DELPHICLASS TDBNavigator;
  809. class DELPHICLASS TNavDataLink;
  810. class PASCALIMPLEMENTATION TNavDataLink : public Db::TDataLink 
  811. {
  812.     typedef Db::TDataLink inherited;
  813.     
  814. private:
  815.     TDBNavigator* FNavigator;
  816.     
  817. protected:
  818.     virtual void __fastcall EditingChanged(void);
  819.     virtual void __fastcall DataSetChanged(void);
  820.     virtual void __fastcall ActiveChanged(void);
  821.     
  822. public:
  823.     __fastcall TNavDataLink(TDBNavigator* ANav);
  824.     __fastcall virtual ~TNavDataLink(void);
  825. };
  826.  
  827. class DELPHICLASS TNavButton;
  828. class PASCALIMPLEMENTATION TDBNavigator : public Extctrls::TCustomPanel 
  829. {
  830.     typedef Extctrls::TCustomPanel inherited;
  831.     
  832. private:
  833.     TNavDataLink* FDataLink;
  834.     TButtonSet FVisibleButtons;
  835.     Classes::TStrings* FHints;
  836.     int ButtonWidth;
  837.     tagPOINT MinBtnSize;
  838.     ENavClick FOnNavClick;
  839.     ENavClick FBeforeAction;
  840.     TNavigateBtn FocusedButton;
  841.     bool FConfirmDelete;
  842.     bool FFlat;
  843.     void __fastcall ClickHandler(System::TObject* Sender);
  844.     Db::TDataSource* __fastcall GetDataSource(void);
  845.     void __fastcall SetDataSource(Db::TDataSource* Value);
  846.     void __fastcall InitButtons(void);
  847.     void __fastcall InitHints(void);
  848.     void __fastcall BtnMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
  849.         Shift, int X, int Y);
  850.     HIDESBASE void __fastcall SetVisible(TButtonSet Value);
  851.     void __fastcall AdjustSize(int &W, int &H);
  852.     void __fastcall HintsChanged(System::TObject* Sender);
  853.     void __fastcall SetHints(Classes::TStrings* Value);
  854.     void __fastcall SetFlat(bool Value);
  855.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  856.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  857.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  858.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  859.     HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Messages::TMessage &Message);
  860.     
  861. protected:
  862.     TNavButton* Buttons[10];
  863.     void __fastcall DataChanged(void);
  864.     void __fastcall EditingChanged(void);
  865.     void __fastcall ActiveChanged(void);
  866.     virtual void __fastcall Loaded(void);
  867.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  868.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  869.         );
  870.     DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
  871.     
  872. public:
  873.     __fastcall virtual TDBNavigator(Classes::TComponent* AOwner);
  874.     __fastcall virtual ~TDBNavigator(void);
  875.     virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
  876.     void __fastcall BtnClick(TNavigateBtn Index);
  877.     
  878. __published:
  879.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  880.     __property TButtonSet VisibleButtons = {read=FVisibleButtons, write=SetVisible, default=1023};
  881.     __property Align ;
  882.     __property DragCursor ;
  883.     __property DragMode ;
  884.     __property Enabled ;
  885.     __property bool Flat = {read=FFlat, write=SetFlat, default=0};
  886.     __property Ctl3D ;
  887.     __property Classes::TStrings* Hints = {read=FHints, write=SetHints};
  888.     __property ParentCtl3D ;
  889.     __property ParentShowHint ;
  890.     __property PopupMenu ;
  891.     __property bool ConfirmDelete = {read=FConfirmDelete, write=FConfirmDelete, default=1};
  892.     __property ShowHint ;
  893.     __property TabOrder ;
  894.     __property TabStop ;
  895.     __property Visible ;
  896.     __property ENavClick BeforeAction = {read=FBeforeAction, write=FBeforeAction};
  897.     __property ENavClick OnClick = {read=FOnNavClick, write=FOnNavClick};
  898.     __property OnDblClick ;
  899.     __property OnDragDrop ;
  900.     __property OnDragOver ;
  901.     __property OnEndDrag ;
  902.     __property OnEnter ;
  903.     __property OnExit ;
  904.     __property OnResize ;
  905.     __property OnStartDrag ;
  906. public:
  907.     /* TWinControl.CreateParented */ __fastcall TDBNavigator(HWND ParentWindow) : Extctrls::TCustomPanel(
  908.         ParentWindow) { }
  909.     
  910. };
  911.  
  912. class PASCALIMPLEMENTATION TNavButton : public Buttons::TSpeedButton 
  913. {
  914.     typedef Buttons::TSpeedButton inherited;
  915.     
  916. private:
  917.     TNavigateBtn FIndex;
  918.     TNavButtonStyle FNavStyle;
  919.     Extctrls::TTimer* FRepeatTimer;
  920.     void __fastcall TimerExpired(System::TObject* Sender);
  921.     
  922. protected:
  923.     virtual void __fastcall Paint(void);
  924.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  925.         int Y);
  926.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  927.         Y);
  928.     
  929. public:
  930.     __fastcall virtual ~TNavButton(void);
  931.     __property TNavButtonStyle NavStyle = {read=FNavStyle, write=FNavStyle, nodefault};
  932.     __property TNavigateBtn Index = {read=FIndex, write=FIndex, nodefault};
  933. public:
  934.     /* TSpeedButton.Create */ __fastcall virtual TNavButton(Classes::TComponent* AOwner) : Buttons::TSpeedButton(
  935.         AOwner) { }
  936.     
  937. };
  938.  
  939. class DELPHICLASS TDataSourceLink;
  940. class DELPHICLASS TDBLookupControl;
  941. class DELPHICLASS TListSourceLink;
  942. class PASCALIMPLEMENTATION TListSourceLink : public Db::TDataLink 
  943. {
  944.     typedef Db::TDataLink inherited;
  945.     
  946. private:
  947.     TDBLookupControl* FDBLookupControl;
  948.     
  949. protected:
  950.     virtual void __fastcall ActiveChanged(void);
  951.     virtual void __fastcall DataSetChanged(void);
  952. public:
  953.     /* TDataLink.Create */ __fastcall TListSourceLink(void) : Db::TDataLink() { }
  954.     /* TDataLink.Destroy */ __fastcall virtual ~TListSourceLink(void) { }
  955.     
  956. };
  957.  
  958. class PASCALIMPLEMENTATION TDBLookupControl : public Controls::TCustomControl 
  959. {
  960.     typedef Controls::TCustomControl inherited;
  961.     
  962. private:
  963.     Db::TDataSource* FLookupSource;
  964.     TDataSourceLink* FDataLink;
  965.     TListSourceLink* FListLink;
  966.     System::AnsiString FDataFieldName;
  967.     System::AnsiString FKeyFieldName;
  968.     System::AnsiString FListFieldName;
  969.     int FListFieldIndex;
  970.     Db::TField* FDataField;
  971.     Db::TField* FMasterField;
  972.     Db::TField* FKeyField;
  973.     Db::TField* FListField;
  974.     Classes::TList* FListFields;
  975.     System::Variant FKeyValue;
  976.     System::AnsiString FSearchText;
  977.     bool FLookupMode;
  978.     bool FListActive;
  979.     bool FFocused;
  980.     bool __fastcall CanModify(void);
  981.     void __fastcall CheckNotCircular(void);
  982.     void __fastcall CheckNotLookup(void);
  983.     void __fastcall DataLinkActiveChanged(void);
  984.     void __fastcall DataLinkRecordChanged(Db::TField* Field);
  985.     int __fastcall GetBorderSize(void);
  986.     Db::TDataSource* __fastcall GetDataSource(void);
  987.     System::AnsiString __fastcall GetKeyFieldName(void);
  988.     Db::TDataSource* __fastcall GetListSource(void);
  989.     bool __fastcall GetReadOnly(void);
  990.     int __fastcall GetTextHeight(void);
  991.     virtual void __fastcall KeyValueChanged(void);
  992.     virtual void __fastcall ListLinkActiveChanged(void);
  993.     virtual void __fastcall ListLinkDataChanged(void);
  994.     bool __fastcall LocateKey(void);
  995.     void __fastcall ProcessSearchKey(char Key);
  996.     void __fastcall SelectKeyValue(const System::Variant &Value);
  997.     void __fastcall SetDataFieldName(const System::AnsiString Value);
  998.     void __fastcall SetDataSource(Db::TDataSource* Value);
  999.     void __fastcall SetKeyFieldName(const System::AnsiString Value);
  1000.     void __fastcall SetKeyValue(const System::Variant &Value);
  1001.     void __fastcall SetListFieldName(const System::AnsiString Value);
  1002.     void __fastcall SetListSource(Db::TDataSource* Value);
  1003.     void __fastcall SetLookupMode(bool Value);
  1004.     void __fastcall SetReadOnly(bool Value);
  1005.     MESSAGE void __fastcall WMGetDlgCode(Messages::TMessage &Message);
  1006.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TMessage &Message);
  1007.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TMessage &Message);
  1008.     
  1009. protected:
  1010.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  1011.         );
  1012.     __property System::AnsiString DataField = {read=FDataFieldName, write=SetDataFieldName};
  1013.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  1014.     __property System::AnsiString KeyField = {read=GetKeyFieldName, write=SetKeyFieldName};
  1015.     __property System::Variant KeyValue = {read=FKeyValue, write=SetKeyValue};
  1016.     __property System::AnsiString ListField = {read=FListFieldName, write=SetListFieldName};
  1017.     __property int ListFieldIndex = {read=FListFieldIndex, write=FListFieldIndex, default=0};
  1018.     __property Db::TDataSource* ListSource = {read=GetListSource, write=SetListSource};
  1019.     __property ParentColor ;
  1020.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  1021.     __property TabStop ;
  1022.     
  1023. public:
  1024.     __fastcall virtual TDBLookupControl(Classes::TComponent* AOwner);
  1025.     __fastcall virtual ~TDBLookupControl(void);
  1026.     __property Db::TField* Field = {read=FDataField};
  1027. public:
  1028.     /* TWinControl.CreateParented */ __fastcall TDBLookupControl(HWND ParentWindow) : Controls::TCustomControl(
  1029.         ParentWindow) { }
  1030.     
  1031. };
  1032.  
  1033. class PASCALIMPLEMENTATION TDataSourceLink : public Db::TDataLink 
  1034. {
  1035.     typedef Db::TDataLink inherited;
  1036.     
  1037. private:
  1038.     TDBLookupControl* FDBLookupControl;
  1039.     
  1040. protected:
  1041.     virtual void __fastcall FocusControl(Db::TFieldRef Field);
  1042.     virtual void __fastcall ActiveChanged(void);
  1043.     virtual void __fastcall RecordChanged(Db::TField* Field);
  1044. public:
  1045.     /* TDataLink.Create */ __fastcall TDataSourceLink(void) : Db::TDataLink() { }
  1046.     /* TDataLink.Destroy */ __fastcall virtual ~TDataSourceLink(void) { }
  1047.     
  1048. };
  1049.  
  1050. class DELPHICLASS TDBLookupListBox;
  1051. class PASCALIMPLEMENTATION TDBLookupListBox : public Dbctrls::TDBLookupControl 
  1052. {
  1053.     typedef Dbctrls::TDBLookupControl inherited;
  1054.     
  1055. private:
  1056.     int FRecordIndex;
  1057.     int FRecordCount;
  1058.     int FRowCount;
  1059.     TFormBorderStyle FBorderStyle;
  1060.     bool FPopup;
  1061.     bool FKeySelected;
  1062.     bool FTracking;
  1063.     bool FTimerActive;
  1064.     bool FLockPosition;
  1065.     int FMousePos;
  1066.     System::AnsiString FSelectedItem;
  1067.     int __fastcall GetKeyIndex(void);
  1068.     virtual void __fastcall KeyValueChanged(void);
  1069.     virtual void __fastcall ListLinkActiveChanged(void);
  1070.     virtual void __fastcall ListLinkDataChanged(void);
  1071.     void __fastcall SelectCurrent(void);
  1072.     void __fastcall SelectItemAt(int X, int Y);
  1073.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  1074.     void __fastcall SetRowCount(int Value);
  1075.     void __fastcall StopTimer(void);
  1076.     void __fastcall StopTracking(void);
  1077.     void __fastcall TimerScroll(void);
  1078.     void __fastcall UpdateScrollBar(void);
  1079.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  1080.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  1081.     HIDESBASE MESSAGE void __fastcall WMCancelMode(Messages::TMessage &Message);
  1082.     MESSAGE void __fastcall WMTimer(Messages::TMessage &Message);
  1083.     HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Message);
  1084.     
  1085. protected:
  1086.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  1087.     virtual void __fastcall CreateWnd(void);
  1088.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  1089.     DYNAMIC void __fastcall KeyPress(char &Key);
  1090.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  1091.         int Y);
  1092.     DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
  1093.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  1094.         Y);
  1095.     virtual void __fastcall Paint(void);
  1096.     virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
  1097.     
  1098. public:
  1099.     __fastcall virtual TDBLookupListBox(Classes::TComponent* AOwner);
  1100.     __property KeyValue ;
  1101.     __property System::AnsiString SelectedItem = {read=FSelectedItem};
  1102.     
  1103. __published:
  1104.     __property Align ;
  1105.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
  1106.     __property Color ;
  1107.     __property Ctl3D ;
  1108.     __property DataField ;
  1109.     __property DataSource ;
  1110.     __property DragCursor ;
  1111.     __property DragMode ;
  1112.     __property Enabled ;
  1113.     __property Font ;
  1114.     __property ImeMode ;
  1115.     __property ImeName ;
  1116.     __property KeyField ;
  1117.     __property ListField ;
  1118.     __property ListFieldIndex ;
  1119.     __property ListSource ;
  1120.     __property ParentColor ;
  1121.     __property ParentCtl3D ;
  1122.     __property ParentFont ;
  1123.     __property ParentShowHint ;
  1124.     __property PopupMenu ;
  1125.     __property ReadOnly ;
  1126.     __property int RowCount = {read=FRowCount, write=SetRowCount, stored=false, nodefault};
  1127.     __property ShowHint ;
  1128.     __property TabOrder ;
  1129.     __property TabStop ;
  1130.     __property Visible ;
  1131.     __property OnClick ;
  1132.     __property OnDblClick ;
  1133.     __property OnDragDrop ;
  1134.     __property OnDragOver ;
  1135.     __property OnEndDrag ;
  1136.     __property OnEnter ;
  1137.     __property OnExit ;
  1138.     __property OnKeyDown ;
  1139.     __property OnKeyPress ;
  1140.     __property OnKeyUp ;
  1141.     __property OnMouseDown ;
  1142.     __property OnMouseMove ;
  1143.     __property OnMouseUp ;
  1144.     __property OnStartDrag ;
  1145. public:
  1146.     /* TDBLookupControl.Destroy */ __fastcall virtual ~TDBLookupListBox(void) { }
  1147.     
  1148. public:
  1149.     /* TWinControl.CreateParented */ __fastcall TDBLookupListBox(HWND ParentWindow) : Dbctrls::TDBLookupControl(
  1150.         ParentWindow) { }
  1151.     
  1152. };
  1153.  
  1154. class DELPHICLASS TPopupDataList;
  1155. class PASCALIMPLEMENTATION TPopupDataList : public Dbctrls::TDBLookupListBox 
  1156. {
  1157.     typedef Dbctrls::TDBLookupListBox inherited;
  1158.     
  1159. private:
  1160.     MESSAGE void __fastcall WMMouseActivate(Messages::TMessage &Message);
  1161.     
  1162. protected:
  1163.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  1164.     
  1165. public:
  1166.     __fastcall virtual TPopupDataList(Classes::TComponent* AOwner);
  1167. public:
  1168.     /* TDBLookupControl.Destroy */ __fastcall virtual ~TPopupDataList(void) { }
  1169.     
  1170. public:
  1171.     /* TWinControl.CreateParented */ __fastcall TPopupDataList(HWND ParentWindow) : Dbctrls::TDBLookupListBox(
  1172.         ParentWindow) { }
  1173.     
  1174. };
  1175.  
  1176. enum TDropDownAlign { daLeft, daRight, daCenter };
  1177.  
  1178. class DELPHICLASS TDBLookupComboBox;
  1179. class PASCALIMPLEMENTATION TDBLookupComboBox : public Dbctrls::TDBLookupControl 
  1180. {
  1181.     typedef Dbctrls::TDBLookupControl inherited;
  1182.     
  1183. private:
  1184.     TPopupDataList* FDataList;
  1185.     int FButtonWidth;
  1186.     System::AnsiString FText;
  1187.     int FDropDownRows;
  1188.     int FDropDownWidth;
  1189.     TDropDownAlign FDropDownAlign;
  1190.     bool FListVisible;
  1191.     bool FPressed;
  1192.     bool FTracking;
  1193.     TAlignment FAlignment;
  1194.     bool FLookupMode;
  1195.     Classes::TNotifyEvent FOnDropDown;
  1196.     Classes::TNotifyEvent FOnCloseUp;
  1197.     virtual void __fastcall KeyValueChanged(void);
  1198.     virtual void __fastcall ListLinkActiveChanged(void);
  1199.     void __fastcall ListMouseUp(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
  1200.         Shift, int X, int Y);
  1201.     void __fastcall StopTracking(void);
  1202.     void __fastcall TrackButton(int X, int Y);
  1203.     MESSAGE void __fastcall CMCancelMode(Controls::TCMCancelMode &Message);
  1204.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  1205.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  1206.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  1207.     HIDESBASE MESSAGE void __fastcall WMCancelMode(Messages::TMessage &Message);
  1208.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  1209.     
  1210. protected:
  1211.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  1212.     virtual void __fastcall Paint(void);
  1213.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  1214.     DYNAMIC void __fastcall KeyPress(char &Key);
  1215.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  1216.         int Y);
  1217.     DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
  1218.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  1219.         Y);
  1220.     virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
  1221.     
  1222. public:
  1223.     __fastcall virtual TDBLookupComboBox(Classes::TComponent* AOwner);
  1224.     void __fastcall CloseUp(bool Accept);
  1225.     void __fastcall DropDown(void);
  1226.     __property KeyValue ;
  1227.     __property bool ListVisible = {read=FListVisible, nodefault};
  1228.     __property System::AnsiString Text = {read=FText};
  1229.     
  1230. __published:
  1231.     __property Color ;
  1232.     __property Ctl3D ;
  1233.     __property DataField ;
  1234.     __property DataSource ;
  1235.     __property DragCursor ;
  1236.     __property DragMode ;
  1237.     __property TDropDownAlign DropDownAlign = {read=FDropDownAlign, write=FDropDownAlign, default=0};
  1238.     __property int DropDownRows = {read=FDropDownRows, write=FDropDownRows, default=7};
  1239.     __property int DropDownWidth = {read=FDropDownWidth, write=FDropDownWidth, default=0};
  1240.     __property Enabled ;
  1241.     __property Font ;
  1242.     __property ImeMode ;
  1243.     __property ImeName ;
  1244.     __property KeyField ;
  1245.     __property ListField ;
  1246.     __property ListFieldIndex ;
  1247.     __property ListSource ;
  1248.     __property ParentColor ;
  1249.     __property ParentCtl3D ;
  1250.     __property ParentFont ;
  1251.     __property ParentShowHint ;
  1252.     __property PopupMenu ;
  1253.     __property ReadOnly ;
  1254.     __property ShowHint ;
  1255.     __property TabOrder ;
  1256.     __property TabStop ;
  1257.     __property Visible ;
  1258.     __property OnClick ;
  1259.     __property Classes::TNotifyEvent OnCloseUp = {read=FOnCloseUp, write=FOnCloseUp};
  1260.     __property OnDragDrop ;
  1261.     __property OnDragOver ;
  1262.     __property Classes::TNotifyEvent OnDropDown = {read=FOnDropDown, write=FOnDropDown};
  1263.     __property OnEndDrag ;
  1264.     __property OnEnter ;
  1265.     __property OnExit ;
  1266.     __property OnKeyDown ;
  1267.     __property OnKeyPress ;
  1268.     __property OnKeyUp ;
  1269.     __property OnMouseDown ;
  1270.     __property OnMouseMove ;
  1271.     __property OnMouseUp ;
  1272.     __property OnStartDrag ;
  1273. public:
  1274.     /* TDBLookupControl.Destroy */ __fastcall virtual ~TDBLookupComboBox(void) { }
  1275.     
  1276. public:
  1277.     /* TWinControl.CreateParented */ __fastcall TDBLookupComboBox(HWND ParentWindow) : Dbctrls::TDBLookupControl(
  1278.         ParentWindow) { }
  1279.     
  1280. };
  1281.  
  1282. class DELPHICLASS TDBRichEdit;
  1283. class PASCALIMPLEMENTATION TDBRichEdit : public Comctrls::TCustomRichEdit 
  1284. {
  1285.     typedef Comctrls::TCustomRichEdit inherited;
  1286.     
  1287. private:
  1288.     TFieldDataLink* FDataLink;
  1289.     bool FAutoDisplay;
  1290.     bool FFocused;
  1291.     bool FMemoLoaded;
  1292.     System::AnsiString FDataSave;
  1293.     void __fastcall BeginEditing(void);
  1294.     void __fastcall DataChange(System::TObject* Sender);
  1295.     void __fastcall EditingChange(System::TObject* Sender);
  1296.     System::AnsiString __fastcall GetDataField(void);
  1297.     Db::TDataSource* __fastcall GetDataSource(void);
  1298.     Db::TField* __fastcall GetField(void);
  1299.     bool __fastcall GetReadOnly(void);
  1300.     void __fastcall SetDataField(const System::AnsiString Value);
  1301.     void __fastcall SetDataSource(Db::TDataSource* Value);
  1302.     HIDESBASE void __fastcall SetReadOnly(bool Value);
  1303.     void __fastcall SetAutoDisplay(bool Value);
  1304.     void __fastcall SetFocused(bool Value);
  1305.     void __fastcall UpdateData(System::TObject* Sender);
  1306.     MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
  1307.     MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
  1308.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  1309.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  1310.     HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  1311.     MESSAGE void __fastcall CMGetDataLink(Messages::TMessage &Message);
  1312.     
  1313. protected:
  1314.     DYNAMIC void __fastcall Change(void);
  1315.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  1316.     DYNAMIC void __fastcall KeyPress(char &Key);
  1317.     virtual void __fastcall Loaded(void);
  1318.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  1319.         );
  1320.     
  1321. public:
  1322.     __fastcall virtual TDBRichEdit(Classes::TComponent* AOwner);
  1323.     __fastcall virtual ~TDBRichEdit(void);
  1324.     void __fastcall LoadMemo(void);
  1325.     __property Db::TField* Field = {read=GetField};
  1326.     
  1327. __published:
  1328.     __property Align ;
  1329.     __property Alignment ;
  1330.     __property bool AutoDisplay = {read=FAutoDisplay, write=SetAutoDisplay, default=1};
  1331.     __property BorderStyle ;
  1332.     __property Color ;
  1333.     __property Ctl3D ;
  1334.     __property System::AnsiString DataField = {read=GetDataField, write=SetDataField};
  1335.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  1336.     __property DragCursor ;
  1337.     __property DragMode ;
  1338.     __property Enabled ;
  1339.     __property Font ;
  1340.     __property HideSelection ;
  1341.     __property HideScrollBars ;
  1342.     __property ImeMode ;
  1343.     __property ImeName ;
  1344.     __property MaxLength ;
  1345.     __property ParentColor ;
  1346.     __property ParentCtl3D ;
  1347.     __property ParentFont ;
  1348.     __property ParentShowHint ;
  1349.     __property PlainText ;
  1350.     __property PopupMenu ;
  1351.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
  1352.     __property ScrollBars ;
  1353.     __property ShowHint ;
  1354.     __property TabOrder ;
  1355.     __property TabStop ;
  1356.     __property Visible ;
  1357.     __property WantReturns ;
  1358.     __property WantTabs ;
  1359.     __property WordWrap ;
  1360.     __property OnChange ;
  1361.     __property OnClick ;
  1362.     __property OnDblClick ;
  1363.     __property OnDragDrop ;
  1364.     __property OnDragOver ;
  1365.     __property OnEndDrag ;
  1366.     __property OnEnter ;
  1367.     __property OnExit ;
  1368.     __property OnKeyDown ;
  1369.     __property OnKeyPress ;
  1370.     __property OnKeyUp ;
  1371.     __property OnMouseDown ;
  1372.     __property OnMouseMove ;
  1373.     __property OnMouseUp ;
  1374.     __property OnResizeRequest ;
  1375.     __property OnSelectionChange ;
  1376.     __property OnProtectChange ;
  1377.     __property OnSaveClipboard ;
  1378.     __property OnStartDrag ;
  1379. public:
  1380.     /* TWinControl.CreateParented */ __fastcall TDBRichEdit(HWND ParentWindow) : Comctrls::TCustomRichEdit(
  1381.         ParentWindow) { }
  1382.     
  1383. };
  1384.  
  1385. //-- var, const, procedure ---------------------------------------------------
  1386. #define InitRepeatPause (Word)(400)
  1387. #define RepeatPause (Byte)(100)
  1388. #define SpaceSize (Byte)(5)
  1389.  
  1390. }    /* namespace Dbctrls */
  1391. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  1392. using namespace Dbctrls;
  1393. #endif
  1394. //-- end unit ----------------------------------------------------------------
  1395. #endif    // DBCtrls
  1396.